<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('海区维护列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>海区名称：</label>
                            <input type="text" name="areaName"/>
                        </li>
                        <li>
                            <label>英文缩写：</label>
                            <input type="text" name="areaCode"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('product:oceanArea:edit')}]];
    var removeFlag = [[${@permission.hasPermi('product:oceanArea:remove')}]];
    var detailFlag = [[${@permission.hasPermi('product:oceanArea:detail')}]];
    var prefix = ctx + "product/oceanArea";

    $(function() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            detailUrl: prefix + "/detail/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            sortName: 'sortOrder',
            sortOrder: 'desc',
            modalName: "海区维护",
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: '',
                    visible: false,
                    ignore: true
                },
                {
                    field: 'areaName',
                    title: '海区名称',
                    sortable: true
                },
                {
                    field: 'areaCode',
                    title: '英文缩写',
                    sortable: true
                },
                {
                    field: 'sortOrder',
                    title: '排序',
                    sortable: true
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="chooseOceanAreaBack(\'' + row.areaCode + '\', \'' + row.areaName + '\')"><i class="fa fa-edit"></i>选择</a> ');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });

    function  chooseOceanAreaBack(oceanCode,oceanName){
        window.parent.chooseOceanAreaCallBack(oceanCode,oceanName);
    }

</script>
</body>
</html>
